/*
 * @Author       : Hugo
 * @Date         : 2020-11-27 11:54:41
 * @LastEditTime : 2020-11-27 11:57:08
 * @LastEditors  : Hugo
 * @FilePath     : /example_front/vue.config.js
 * @Description  : 
 * @^_^          : 
 */
module.exports = {
  "transpileDependencies": [
    "vuetify"
  ],
  /**
   * 公共css
   */
  css: {
    loaderOptions: {
     
      //配置公共变量
      scss: {
        prependData: `@import "@/style/common/global.scss";`,
      },

     
    }
  },
  
  chainWebpack: config => {
    // [babel-polyfill相关配置]
    // 在chainWebpack中添加下面的代码
    // config.entry('main').add('babel-polyfill') // main是入口js文件
    /**
     * sass-resource-loader配置公共scss函数，mixin等
     */
    const oneOfsMap = config.module.rule('scss').oneOfs.store
    oneOfsMap.forEach(item => {
      item
        .use('sass-resources-loader')
        .loader('sass-resources-loader')
        .options({
          // Provide path to the file with resources
          resources: './src/style/common/common.scss',

          // Or array of paths
          // resources: ['./path/to/vars.scss', './path/to/mixins.scss']
        })
        .end()
    })
  }
}